/*
 * OREKIT-X
 * Copyright 2002-2008 CS Communication & Systemes
 * 
 * Parts of this software package have been licensed to CS
 * Communication & Systemes (CS) under one or more contributor license
 * agreements.  See the NOTICE file distributed with this work for
 * additional information.
 *  
 * This is an experimental copy of OREKIT from www.orekit.org.
 * Please use the original OREKIT from orekit.org for normal work
 * unrelated to this research project.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you
 * may not use this file except in compliance with the License.  You
 * may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied.  See the License for the specific language governing
 * permissions and limitations under the License.
 */
package ore.data;

/** 
 * Planetary term of a nutation series.
 * 
 * @see SeriesTerm
 * 
 * @author Luc Maisonobe
 */
class PlanetaryTerm
    extends SeriesTerm
{

    /** 
     * Coefficient for mean Mercury longitude.
     */
    private final int cMe;
    /** 
     * Coefficient for mean Venus longitude.
     */
    private final int cVe;
    /** 
     * Coefficient for mean Earth longitude.
     */
    private final int cE;
    /** 
     * Coefficient for mean Mars longitude.
     */
    private final int cMa;
    /** 
     * Coefficient for mean Jupiter longitude.
     */
    private final int cJu;
    /** 
     * Coefficient for mean Saturn longitude.
     */
    private final int cSa;
    /** 
     * Coefficient for mean Uranus longitude.
     */
    private final int cUr;
    /** 
     * Coefficient for mean Neptune longitude.
     */
    private final int cNe;
    /** 
     * Coefficient for general accumulated precession in longitude.
     */
    private final int cPa;


    /** 
     * @param sinCoeff Coefficient for the sine of the argument
     * @param cosCoeff Coefficient for the cosine of the argument
     * @param cMe Coefficient for mean Mercury longitude
     * @param cVe Coefficient for mean Venus longitude
     * @param cE Coefficient for mean Earth longitude
     * @param cMa Coefficient for mean Mars longitude
     * @param cJu Coefficient for mean Jupiter longitude
     * @param cSa Coefficient for mean Saturn longitude
     * @param cUr Coefficient for mean Uranus longitude
     * @param cNe Coefficient for mean Neptune longitude
     * @param cPa Coefficient for general accumulated precession in longitude
      */
    public PlanetaryTerm(double sinCoeff, double cosCoeff,
                         int cMe, int cVe, int cE, int cMa, int cJu,
                         int cSa, int cUr, int cNe, int cPa)
    {
        super(sinCoeff, cosCoeff);
        this.cMe = cMe;
        this.cVe = cVe;
        this.cE  = cE;
        this.cMa = cMa;
        this.cJu = cJu;
        this.cSa = cSa;
        this.cUr = cUr;
        this.cNe = cNe;
        this.cPa = cPa;
    }


    /** {@inheritDoc}
     */
    protected double argument(BodiesElements elements) {
        return cMe * elements.getLMe() + cVe * elements.getLVe() + cE  * elements.getLE() +
               cMa * elements.getLMa() + cJu * elements.getLJu() +
               cSa * elements.getLSa() + cUr * elements.getLUr() +
               cNe * elements.getLNe() + cPa * elements.getPa();
    }

}
